<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<script>
$(function(){
	$('#submitButton').click(function(){
		var err='';
		if(document.groupForm.id.value==''){
			err+='请填代码\r\n';
		}
		if(document.groupForm.name.value==''){
			err+='请填名称\r\n';
		}
		if(err!=''){
			alert(err);
		}else{
			document.groupForm.submit();
		}
	});
});
</script>
<c-rt:if test="${empty taskGroup && !empty param.taskGroupId}">
${pu:reqSet('taskGroup', pu:get('com.yaodian100.crm.workorder.entity.TaskGroup', param.taskGroupId)) }
</c-rt:if>

<div class="f-link"><a href="/ecadmin/cs/taskGroup/page.do?iamlazy=list" id="list">任務群組管理</a></div>
<div class="f-link"><a href="/ecadmin/cs/taskGroup/page.do?iamlazy=userList" id="userList">使用者列表</a></div>
<h1>
<c-rt:if test="${empty taskGroup}">
新增
</c-rt:if>
<c-rt:if test="${!empty taskGroup}">
修改
</c-rt:if>
任务分组
</h1>
${message }
<form name="groupForm" method="post" action="/ecadmin/cs/taskGroup/update.do">
<table class="tb-data" width="100%">
<tr><th>父群组</th><td>
${pu:reqSet('parents', pu:queryByHql('from TaskGroup', null, null)) }
<select name="parentId">
<option value="">选择父群组</option>
<c-rt:forEach items="${parents}" var="parent">
<option value="${parent.id }" <c-rt:if test="${parent.id==taskGroup.parent.id }">selected="selected"</c-rt:if>>${parent.name }</option>
</c-rt:forEach>
</select>
</td></tr>
<tr><th>代码(禁用中文)</th><td><input type="text" name="id" value="${taskGroup.id }"/></td></tr>
<tr><th>名称</th><td><input type="text" name="name" value="${taskGroup.name }"/></td></tr>
<tr><th>致能</th><td><input type="radio" name="enable" value="true" <c-rt:if test="${taskGroup.enable || empty taskGroup }">checked="checked"</c-rt:if>/>致能<input type="radio" name="enable" value="false" <c-rt:if test="${!empty taskGroup && !taskGroup.enable }">checked="checked"</c-rt:if>/>不致能</td></tr>
<tr><th></th><td>
<input type="button" value="送出" id="submitButton"/>
<input type="reset" value="重置"/>
</td></tr>
</table>
</form>